home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / quake.zip / HIPGRAPL.ZIP / HIPWATER.QC < prev    next >
Text File  |  1997-01-16  |  1KB  |  54 lines

  1. /* Water QuickC program
  2.    By Jim Dose'  12/16/96
  3.    Copyright (c)1996 Hipnotic Interactive, Inc.
  4.    All rights reserved.
  5.    Do not distribute.
  6. */
  7.  
  8. void() bobbingwater_think =
  9.    {
  10.    local vector ang;
  11.  
  12.    self.count = self.count + self.speed * ( time - self.ltime );
  13.    if ( self.count > 360 )
  14.       {
  15.       self.count = self.count - 360;
  16.       }
  17.    ang_x = self.count;
  18.    ang_y = 0;
  19.    ang_z = 0;
  20.    makevectors( ang );
  21.    self.origin_z = v_forward_z * self.cnt;
  22.    setorigin( self, self.origin );
  23.    self.ltime = time;
  24.    self.nextthink = time + 0.02;
  25.    };
  26.  
  27. /*QUAKED func_bobbingwater (0 .5 .8) ?
  28. Used to emulate water.  To use, create a thin water brush and center it
  29. on the water line of the body of water to bob.  The amount of the bob
  30. is the depth of the brush.
  31.  
  32. "speed" is how long in seconds it takes the brush to do one full bob.
  33. */
  34. void() func_bobbingwater =
  35.    {
  36.    self.angles = '0 0 0';
  37.    self.movetype = MOVETYPE_STEP;
  38.    self.solid = SOLID_NOT;
  39.    setmodel (self,self.model);
  40.    self.think = bobbingwater_think;
  41.  
  42.    self.count = 0;
  43.    self.cnt = self.size_z / 2;
  44.    if ( !self.speed )
  45.       {
  46.       self.speed = 4;
  47.       }
  48.  
  49.    self.speed = 360 / self.speed;
  50.  
  51.    self.nextthink = time + 0.02;
  52.    self.ltime = time;
  53.    };
  54.